package com.gdit.revenue.controller;

import com.alibaba.druid.support.logging.Log;
import com.alibaba.druid.support.logging.LogFactory;
import com.gdit.revenue.RevenueApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/api")
public class ApiController {

    private static final Log log = LogFactory.getLog(RevenueApplication.class);

    @RequestMapping("/getPage")
    public ModelAndView getPage(ModelAndView mv, String pageName){
        log.warn("当前用户打开了新页面"+pageName);
        //如果pageName为空，则pageName= Index.html,否则不变
        pageName=null==pageName?"index":pageName;
        //设置转向视图的名称
        mv.setViewName(pageName);
        //返回模型视图对象
        return mv;
    }




}
